package gradation.transformation;

public class PiecewisePoint implements Comparable<PiecewisePoint> {

	private int input;
	private int output;

	public PiecewisePoint() {

	}

	public PiecewisePoint(int in, int out) {
		input = in;
		output = out;
	}

	public double calculateSlope(PiecewisePoint p) {
		return ((double) (output - p.output)) / (input - p.input);
	}

	public int getInput() {
		return input;
	}

	public void setInput(int input) {
		this.input = input;
	}

	public int getOutput() {
		return output;
	}

	public void setOutput(int output) {
		this.output = output;
	}

	@Override
	public int compareTo(PiecewisePoint o) {
		return input - o.input;
	}

}
